package leetcode_2401_2500;

import java.util.Arrays;

public class LeeCode_2500 {
    public static void main(String[] args) {

    }
    private static int deleteGreatestValue(int[][] grid) {
        int m = grid.length, n = grid[0].length;
        for (int[] ints : grid) {
            Arrays.sort(ints);
        }
        int ans = 0;
        for (int j = 0; j < n; j++) {
            int max = 0;
            for (int[] ints : grid) {
                max = Math.max(max, ints[j]);
            }
            ans += max;
        }
        return ans;
    }
}
